<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserLevelTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_level', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 100)->default('')->comment('等级名称');
            $table->decimal('amount', 10)->default(0.00)->comment('累计消费金额');
            $table->decimal('discount', 10, 1)->default(0.0)->comment('折扣');
            $table->string('description')->default('')->comment('等级描述');
            $table->string('image')->default('')->comment('等级图片');
            $table->timestamp('created_at');
            $table->timestamp('updated_at');
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_level');
    }
}
